package com.aisile.aisile_crowd_funding.common.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*
*  异常处理类
* */
//controller增强注解
//当controller报异时 可以在此类捕获   Exception 空指针异常 NullPointException 类强转ClassCastException

@ControllerAdvice
public class ErrorHandler {
    @ExceptionHandler(value =NullPointerException.class)
    public void NullPointerException(HttpServletRequest request, HttpServletResponse response){

    }
    @ExceptionHandler(value =ClassCastException.class)
    public void ClassCastException(){

    }
    @ExceptionHandler(value =Exception.class)

    public void exceptionHandler(){

    }
}
